﻿#include "HelpDialog.h"
#include "../../MirGraphics/MLibrary.h"
#include "../../MirSounds/SoundManager.h"
#include "../../Settings.h"
#include "../../KeyBindSettings.h"
#include "../../Forms/Client.CMain.h"

using namespace Client::MirControls;
using namespace Client::MirGraphics;
using namespace Client::MirNetwork;
using namespace Client::MirObjects;
using namespace Client::MirSounds;
namespace S = ServerPackets;
namespace C = ClientPackets;

namespace Client::MirScenes::Dialogs
{

    HelpDialog::HelpDialog()
    {
        setIndex(920);
        setLibrary(Libraries::Prguse);
        setMovable(true);
        setSort(true);

        setLocation(getCenter());

        MirImageControl *TitleLabel = new MirImageControl();
        TitleLabel->setIndex(57);
        TitleLabel->setLibrary(Libraries::Title);
        Point tempVar(18, 9);
        TitleLabel->setLocation(&tempVar);
        TitleLabel->setParent(this);

        PreviousButton = new MirButton();
        PreviousButton->setIndex(240);
        PreviousButton->setHoverIndex(241);
        PreviousButton->setPressedIndex(242);
        PreviousButton->setLibrary(Libraries::Prguse2);
        PreviousButton->setParent(this);
        Size tempVar2(16, 16);
        PreviousButton->setSize(&tempVar2);
        Point tempVar3(210, 485);
        PreviousButton->setLocation(&tempVar3);
        PreviousButton->setSound(SoundList::ButtonA);
        PreviousButton->Click += [&] (o, e)
        {
            CurrentPageNumber--;
    
            if (CurrentPageNumber < 0)
            {
                CurrentPageNumber = Pages.size() - 1;
            }
    
            DisplayPage(CurrentPageNumber);
        };

        NextButton = new MirButton();
        NextButton->setIndex(243);
        NextButton->setHoverIndex(244);
        NextButton->setPressedIndex(245);
        NextButton->setLibrary(Libraries::Prguse2);
        NextButton->setParent(this);
        Size tempVar4(16, 16);
        NextButton->setSize(&tempVar4);
        Point tempVar5(310, 485);
        NextButton->setLocation(&tempVar5);
        NextButton->setSound(SoundList::ButtonA);
        NextButton->Click += [&] (o, e)
        {
            CurrentPageNumber++;
    
            if (CurrentPageNumber > Pages.size() - 1)
            {
                CurrentPageNumber = 0;
            }
    
            DisplayPage(CurrentPageNumber);
        };

        PageLabel = new MirLabel();
        PageLabel->setText("");
        Font tempVar6(Settings::FontName, 9.0F);
        PageLabel->setFont(&tempVar6);
        PageLabel->setDrawFormat(TextFormatFlags::VerticalCenter | TextFormatFlags::HorizontalCenter);
        PageLabel->setParent(this);
        PageLabel->setNotControl(true);
        Point tempVar7(230, 480);
        PageLabel->setLocation(&tempVar7);
        Size tempVar8(80, 20);
        PageLabel->setSize(&tempVar8);

        CloseButton = new MirButton();
        CloseButton->setHoverIndex(361);
        CloseButton->setIndex(360);
        Point tempVar9(509, 3);
        CloseButton->setLocation(&tempVar9);
        CloseButton->setLibrary(Libraries::Prguse2);
        CloseButton->setParent(this);
        CloseButton->setPressedIndex(362);
        CloseButton->setSound(SoundList::ButtonA);
        CloseButton->Click += [&] (o, e)
        {
            Hide();
        };

        LoadImagePages();

        DisplayPage();

        delete TitleLabel;
    }

    void HelpDialog::LoadImagePages()
    {
        Point *location = new Point(12, 35);

        std::unordered_map<std::string, std::string> keybinds;

        ShortcutPage1 *tempVar2 = new ShortcutPage1();
        tempVar->Parent = this;
        tempVar->Location = location;
        tempVar->Visible = false;
        ShortcutPage2 *tempVar4 = new ShortcutPage2();
        tempVar3->Parent = this;
        tempVar3->Location = location;
        tempVar3->Visible = false;
        ShortcutPage3 *tempVar6 = new ShortcutPage3();
        tempVar5->Parent = this;
        tempVar5->Location = location;
        tempVar5->Visible = false;
        HelpPage *tempVar7 = new HelpPage("Movements", 0, nullptr);
        tempVar7->setParent(this);
        tempVar7->setLocation(location);
        tempVar7->setVisible(false);
        HelpPage *tempVar8 = new HelpPage("Attacking", 1, nullptr);
        tempVar8->setParent(this);
        tempVar8->setLocation(location);
        tempVar8->setVisible(false);
        HelpPage *tempVar9 = new HelpPage("Collecting Items", 2, nullptr);
        tempVar9->setParent(this);
        tempVar9->setLocation(location);
        tempVar9->setVisible(false);
        HelpPage *tempVar10 = new HelpPage("Health", 3, nullptr);
        tempVar10->setParent(this);
        tempVar10->setLocation(location);
        tempVar10->setVisible(false);
        HelpPage *tempVar11 = new HelpPage("Skills", 4, nullptr);
        tempVar11->setParent(this);
        tempVar11->setLocation(location);
        tempVar11->setVisible(false);
        HelpPage *tempVar12 = new HelpPage("Skills", 5, nullptr);
        tempVar12->setParent(this);
        tempVar12->setLocation(location);
        tempVar12->setVisible(false);
        HelpPage *tempVar13 = new HelpPage("Mana", 6, nullptr);
        tempVar13->setParent(this);
        tempVar13->setLocation(location);
        tempVar13->setVisible(false);
        HelpPage *tempVar14 = new HelpPage("Chatting", 7, nullptr);
        tempVar14->setParent(this);
        tempVar14->setLocation(location);
        tempVar14->setVisible(false);
        HelpPage *tempVar15 = new HelpPage("Groups", 8, nullptr);
        tempVar15->setParent(this);
        tempVar15->setLocation(location);
        tempVar15->setVisible(false);
        HelpPage *tempVar16 = new HelpPage("Durability", 9, nullptr);
        tempVar16->setParent(this);
        tempVar16->setLocation(location);
        tempVar16->setVisible(false);
        HelpPage *tempVar17 = new HelpPage("Purchasing", 10, nullptr);
        tempVar17->setParent(this);
        tempVar17->setLocation(location);
        tempVar17->setVisible(false);
        HelpPage *tempVar18 = new HelpPage("Selling", 11, nullptr);
        tempVar18->setParent(this);
        tempVar18->setLocation(location);
        tempVar18->setVisible(false);
        HelpPage *tempVar19 = new HelpPage("Repairing", 12, nullptr);
        tempVar19->setParent(this);
        tempVar19->setLocation(location);
        tempVar19->setVisible(false);
        HelpPage *tempVar20 = new HelpPage("Trading", 13, nullptr);
        tempVar20->setParent(this);
        tempVar20->setLocation(location);
        tempVar20->setVisible(false);
        HelpPage *tempVar21 = new HelpPage("Inspecting", 14, nullptr);
        tempVar21->setParent(this);
        tempVar21->setLocation(location);
        tempVar21->setVisible(false);
        HelpPage *tempVar22 = new HelpPage("Statistics", 15, nullptr);
        tempVar22->setParent(this);
        tempVar22->setLocation(location);
        tempVar22->setVisible(false);
        HelpPage *tempVar23 = new HelpPage("Statistics", 16, nullptr);
        tempVar23->setParent(this);
        tempVar23->setLocation(location);
        tempVar23->setVisible(false);
        HelpPage *tempVar24 = new HelpPage("Statistics", 17, nullptr);
        tempVar24->setParent(this);
        tempVar24->setLocation(location);
        tempVar24->setVisible(false);
        HelpPage *tempVar25 = new HelpPage("Statistics", 18, nullptr);
        tempVar25->setParent(this);
        tempVar25->setLocation(location);
        tempVar25->setVisible(false);
        HelpPage *tempVar26 = new HelpPage("Statistics", 19, nullptr);
        tempVar26->setParent(this);
        tempVar26->setLocation(location);
        tempVar26->setVisible(false);
        HelpPage *tempVar27 = new HelpPage("Statistics", 20, nullptr);
        tempVar27->setParent(this);
        tempVar27->setLocation(location);
        tempVar27->setVisible(false);
        HelpPage *tempVar28 = new HelpPage("Quests", 21, nullptr);
        tempVar28->setParent(this);
        tempVar28->setLocation(location);
        tempVar28->setVisible(false);
        HelpPage *tempVar29 = new HelpPage("Quests", 22, nullptr);
        tempVar29->setParent(this);
        tempVar29->setLocation(location);
        tempVar29->setVisible(false);
        HelpPage *tempVar30 = new HelpPage("Quests", 23, nullptr);
        tempVar30->setParent(this);
        tempVar30->setLocation(location);
        tempVar30->setVisible(false);
        HelpPage *tempVar31 = new HelpPage("Quests", 24, nullptr);
        tempVar31->setParent(this);
        tempVar31->setLocation(location);
        tempVar31->setVisible(false);
        HelpPage *tempVar32 = new HelpPage("Mounts", 25, nullptr);
        tempVar32->setParent(this);
        tempVar32->setLocation(location);
        tempVar32->setVisible(false);
        HelpPage *tempVar33 = new HelpPage("Mounts", 26, nullptr);
        tempVar33->setParent(this);
        tempVar33->setLocation(location);
        tempVar33->setVisible(false);
        HelpPage *tempVar34 = new HelpPage("Fishing", 27, nullptr);
        tempVar34->setParent(this);
        tempVar34->setLocation(location);
        tempVar34->setVisible(false);
        HelpPage *tempVar35 = new HelpPage("Gems and Orbs", 28, nullptr);
        tempVar35->setParent(this);
        tempVar35->setLocation(location);
        tempVar35->setVisible(false);
        std::vector<HelpPage*> imagePages = {tempVar, tempVar3, tempVar5, tempVar7, tempVar8, tempVar9, tempVar10, tempVar11, tempVar12, tempVar13, tempVar14, tempVar15, tempVar16, tempVar17, tempVar18, tempVar19, tempVar20, tempVar21, tempVar22, tempVar23, tempVar24, tempVar25, tempVar26, tempVar27, tempVar28, tempVar29, tempVar30, tempVar31, tempVar32, tempVar33, tempVar34, tempVar35};
        tempVar6->setParent(this);
        HelpPage *tempVar5 = new HelpPage("Chat Shortcuts", -1, tempVar6);
        tempVar4->setParent(this);
        HelpPage *tempVar3 = new HelpPage("Shortcut Information", -1, tempVar4);
        tempVar2->setParent(this);
        HelpPage *tempVar = new HelpPage("Shortcut Information", -1, tempVar2);

        Pages.insert(Pages.end(), imagePages.begin(), imagePages.end());

        delete tempVar;
        delete tempVar3;
        delete tempVar5;
        delete tempVar35;
        delete tempVar34;
        delete tempVar33;
        delete tempVar32;
        delete tempVar31;
        delete tempVar30;
        delete tempVar29;
        delete tempVar28;
        delete tempVar27;
        delete tempVar26;
        delete tempVar25;
        delete tempVar24;
        delete tempVar23;
        delete tempVar22;
        delete tempVar21;
        delete tempVar20;
        delete tempVar19;
        delete tempVar18;
        delete tempVar17;
        delete tempVar16;
        delete tempVar15;
        delete tempVar14;
        delete tempVar13;
        delete tempVar12;
        delete tempVar11;
        delete tempVar10;
        delete tempVar9;
        delete tempVar8;
        delete tempVar7;
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar6' statement was not added since tempVar6 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar4' statement was not added since tempVar4 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete tempVar2' statement was not added since tempVar2 was passed to a method or constructor. Handle memory management manually.
//C# TO C++ CONVERTER TODO TASK: A 'delete location' statement was not added since location was assigned to another object. Handle memory management manually.
    }

    void HelpDialog::DisplayPage(const std::string &pageName)
    {
        if (Pages.size() < 1)
        {
            return;
        }

        for (int i = 0; i < Pages.size(); i++)
        {
            if (StringHelper::toLower(Pages[i]->Title) != StringHelper::toLower(pageName))
            {
                continue;
            }

            DisplayPage(i);
            break;
        }
    }

    void HelpDialog::DisplayPage(int id)
    {
        if (Pages.size() < 1)
        {
            return;
        }

        if (id > Pages.size() - 1)
        {
            id = Pages.size() - 1;
        }
        if (id < 0)
        {
            id = 0;
        }

        if (CurrentPage != nullptr)
        {
            CurrentPage->setVisible(false);
            if (CurrentPage->Page != nullptr)
            {
                CurrentPage->Page->setVisible(false);
            }
        }

        CurrentPage = Pages[id];

        if (CurrentPage == nullptr)
        {
            return;
        }

        CurrentPage->setVisible(true);
        if (CurrentPage->Page != nullptr)
        {
            CurrentPage->Page->setVisible(true);
        }
        CurrentPageNumber = id;

        CurrentPage->PageTitleLabel->setText(std::to_string(id) + std::to_string(1) + ". " + CurrentPage->Title);

        PageLabel->setText(StringHelper::formatSimple("{0} / {1}", id + 1, Pages.size()));

        Show();
    }

    void HelpDialog::Toggle()
    {
        if (!getVisible())
        {
            Show();
        }
        else
        {
            Hide();
        }
    }

    ShortcutPage1::ShortcutPage1()
    {
        Shortcuts = std::vector<ShortcutInfo*>();
        ShortcutInfo tempVar(CMain::InputKeys->GetKey(KeybindOptions::Exit), "Exit the game");
        Shortcuts.push_back(&tempVar);
        ShortcutInfo tempVar2(CMain::InputKeys->GetKey(KeybindOptions::Logout), "Log out");
        Shortcuts.push_back(&tempVar2);
        ShortcutInfo tempVar3(CMain::InputKeys->GetKey(KeybindOptions::Bar1Skill1) + "-" + CMain::InputKeys->GetKey(KeybindOptions::Bar1Skill8), "Skill buttons");
        Shortcuts.push_back(&tempVar3);
        ShortcutInfo tempVar4(CMain::InputKeys->GetKey(KeybindOptions::Inventory), "Inventory window (open / close)");
        Shortcuts.push_back(&tempVar4);
        ShortcutInfo tempVar5(CMain::InputKeys->GetKey(KeybindOptions::Equipment), "Status window (open / close)");
        Shortcuts.push_back(&tempVar5);
        ShortcutInfo tempVar6(CMain::InputKeys->GetKey(KeybindOptions::Skills), "Skill window (open / close)");
        Shortcuts.push_back(&tempVar6);
        ShortcutInfo tempVar7(CMain::InputKeys->GetKey(KeybindOptions::Group), "Group window (open / close)");
        Shortcuts.push_back(&tempVar7);
        ShortcutInfo tempVar8(CMain::InputKeys->GetKey(KeybindOptions::Trade), "Trade window (open / close)");
        Shortcuts.push_back(&tempVar8);
        ShortcutInfo tempVar9(CMain::InputKeys->GetKey(KeybindOptions::Friends), "Friend window (open / close)");
        Shortcuts.push_back(&tempVar9);
        ShortcutInfo tempVar10(CMain::InputKeys->GetKey(KeybindOptions::Minimap), "Minimap window (open / close)");
        Shortcuts.push_back(&tempVar10);
        ShortcutInfo tempVar11(CMain::InputKeys->GetKey(KeybindOptions::Guilds), "Guild window (open / close)");
        Shortcuts.push_back(&tempVar11);
        ShortcutInfo tempVar12(CMain::InputKeys->GetKey(KeybindOptions::GameShop), "Gameshop window (open / close)");
        Shortcuts.push_back(&tempVar12);
        //Shortcuts.Add(new ShortcutInfo("K", "Rental window (open / close)"));
        ShortcutInfo tempVar13(CMain::InputKeys->GetKey(KeybindOptions::Relationship), "Engagement window (open / close)");
        Shortcuts.push_back(&tempVar13);
        ShortcutInfo tempVar14(CMain::InputKeys->GetKey(KeybindOptions::Belt), "Belt window (open / close)");
        Shortcuts.push_back(&tempVar14);
        ShortcutInfo tempVar15(CMain::InputKeys->GetKey(KeybindOptions::Options), "Option window (open / close)");
        Shortcuts.push_back(&tempVar15);
        ShortcutInfo tempVar16(CMain::InputKeys->GetKey(KeybindOptions::Help), "Help window (open / close)");
        Shortcuts.push_back(&tempVar16);
        ShortcutInfo tempVar17(CMain::InputKeys->GetKey(KeybindOptions::Mount), "Mount / Dismount ride");
        Shortcuts.push_back(&tempVar17);

        LoadKeyBinds();
    }

    ShortcutPage2::ShortcutPage2()
    {
        Shortcuts = std::vector<ShortcutInfo*>();
        ShortcutInfo tempVar(CMain::InputKeys->GetKey(KeybindOptions::ChangePetmode), "Toggle pet attack pet");
        Shortcuts.push_back(&tempVar);
        //Shortcuts.Add(new ShortcutInfo("Ctrl + F", "Change the font in the chat box"));
        ShortcutInfo tempVar2(CMain::InputKeys->GetKey(KeybindOptions::ChangeAttackmode), "Toggle player attack mode");
        Shortcuts.push_back(&tempVar2);
        ShortcutInfo tempVar3(CMain::InputKeys->GetKey(KeybindOptions::AttackmodePeace), "Peace Mode - Attack monsters only");
        Shortcuts.push_back(&tempVar3);
        ShortcutInfo tempVar4(CMain::InputKeys->GetKey(KeybindOptions::AttackmodeGroup), "Group Mode - Attack all subjects except your group members");
        Shortcuts.push_back(&tempVar4);
        ShortcutInfo tempVar5(CMain::InputKeys->GetKey(KeybindOptions::AttackmodeGuild), "Guild Mode - Attack all subjects except your guild members");
        Shortcuts.push_back(&tempVar5);
        ShortcutInfo tempVar6(CMain::InputKeys->GetKey(KeybindOptions::AttackmodeRedbrown), "Good/Evil Mode - Attack PK players and monsters only");
        Shortcuts.push_back(&tempVar6);
        ShortcutInfo tempVar7(CMain::InputKeys->GetKey(KeybindOptions::AttackmodeAll), "All Attack Mode - Attack all subjects");
        Shortcuts.push_back(&tempVar7);
        ShortcutInfo tempVar8(CMain::InputKeys->GetKey(KeybindOptions::Bigmap), "Show the field map");
        Shortcuts.push_back(&tempVar8);
        ShortcutInfo tempVar9(CMain::InputKeys->GetKey(KeybindOptions::Skillbar), "Show the skill bar");
        Shortcuts.push_back(&tempVar9);
        ShortcutInfo tempVar10(CMain::InputKeys->GetKey(KeybindOptions::Autorun), "Auto run on / off");
        Shortcuts.push_back(&tempVar10);
        ShortcutInfo tempVar11(CMain::InputKeys->GetKey(KeybindOptions::Cameramode), "Show / Hide interface");
        Shortcuts.push_back(&tempVar11);
        ShortcutInfo tempVar12(CMain::InputKeys->GetKey(KeybindOptions::Pickup), "Highlight / Pickup Items");
        Shortcuts.push_back(&tempVar12);
        ShortcutInfo tempVar13("Ctrl + Right Click", "Show other players kits");
        Shortcuts.push_back(&tempVar13);
        //Shortcuts.Add(new ShortcutInfo("F12", "Chat macros"));
        ShortcutInfo tempVar14(CMain::InputKeys->GetKey(KeybindOptions::Screenshot), "Screen Capture");
        Shortcuts.push_back(&tempVar14);
        ShortcutInfo tempVar15(CMain::InputKeys->GetKey(KeybindOptions::Fishing), "Open / Close fishing window");
        Shortcuts.push_back(&tempVar15);
        ShortcutInfo tempVar16(CMain::InputKeys->GetKey(KeybindOptions::Mentor), "Mentor window (open / close)");
        Shortcuts.push_back(&tempVar16);
        ShortcutInfo tempVar17(CMain::InputKeys->GetKey(KeybindOptions::CreaturePickup), "Creature Pickup (Multi Mouse Target)");
        Shortcuts.push_back(&tempVar17);
        ShortcutInfo tempVar18(CMain::InputKeys->GetKey(KeybindOptions::CreatureAutoPickup), "Creature Pickup (Single Mouse Target)");
        Shortcuts.push_back(&tempVar18);

        LoadKeyBinds();
    }

    ShortcutPage3::ShortcutPage3()
    {
        Shortcuts = std::vector<ShortcutInfo*>();
        //Shortcuts.Add(new ShortcutInfo("` / Ctrl", "Change the skill bar"));
        ShortcutInfo tempVar("/(username)", "Command to whisper to others");
        Shortcuts.push_back(&tempVar);
        ShortcutInfo tempVar2("!(text)", "Command to shout to others nearby");
        Shortcuts.push_back(&tempVar2);
        ShortcutInfo tempVar3("!~(text)", "Command to guild chat");
        Shortcuts.push_back(&tempVar3);

        LoadKeyBinds();
    }

    std::string ShortcutInfo::getShortcut() const
    {
        return Shortcut;
    }

    void ShortcutInfo::setShortcut(const std::string &value)
    {
        Shortcut = value;
    }

    std::string ShortcutInfo::getInformation() const
    {
        return Information;
    }

    void ShortcutInfo::setInformation(const std::string &value)
    {
        Information = value;
    }

    ShortcutInfo::ShortcutInfo(const std::string &shortcut, const std::string &info)
    {
        setShortcut(StringHelper::replace(shortcut, "\n", " + "));
        setInformation(info);
    }

    ShortcutInfoPage::ShortcutInfoPage()
    {
        setVisible(false);

        MirLabel *shortcutTitleLabel = new MirLabel();
        shortcutTitleLabel->setText("Shortcuts");
        shortcutTitleLabel->setDrawFormat(TextFormatFlags::HorizontalCenter | TextFormatFlags::VerticalCenter);
        shortcutTitleLabel->setForeColour(Color::White);
        Font tempVar(Settings::FontName, 10.0F);
        shortcutTitleLabel->setFont(&tempVar);
        shortcutTitleLabel->setParent(this);
        shortcutTitleLabel->setAutoSize(true);
        Point tempVar2(13, 75);
        shortcutTitleLabel->setLocation(&tempVar2);
        Size tempVar3(100, 30);
        shortcutTitleLabel->setSize(&tempVar3);

        MirLabel *infoTitleLabel = new MirLabel();
        infoTitleLabel->setText("Information");
        infoTitleLabel->setDrawFormat(TextFormatFlags::HorizontalCenter | TextFormatFlags::VerticalCenter);
        infoTitleLabel->setForeColour(Color::White);
        Font tempVar4(Settings::FontName, 10.0F);
        infoTitleLabel->setFont(&tempVar4);
        infoTitleLabel->setParent(this);
        infoTitleLabel->setAutoSize(true);
        Point tempVar5(114, 75);
        infoTitleLabel->setLocation(&tempVar5);
        Size tempVar6(405, 30);
        infoTitleLabel->setSize(&tempVar6);

        delete infoTitleLabel;
        delete shortcutTitleLabel;
    }

    void ShortcutInfoPage::LoadKeyBinds()
    {
        if (Shortcuts.empty())
        {
            return;
        }

        for (int i = 0; i < Shortcuts.size(); i++)
        {
            MirLabel *shortcutLabel = new MirLabel();
            shortcutLabel->setText(Shortcuts[i]->getShortcut());
            shortcutLabel->setForeColour(Color::Yellow);
            shortcutLabel->setDrawFormat(TextFormatFlags::VerticalCenter);
            Font tempVar(Settings::FontName, 9.0F);
            shortcutLabel->setFont(&tempVar);
            shortcutLabel->setParent(this);
            shortcutLabel->setAutoSize(true);
            Point tempVar2(18, 107 + (20 * i));
            shortcutLabel->setLocation(&tempVar2);
            Size tempVar3(95, 23);
            shortcutLabel->setSize(&tempVar3);

            MirLabel *informationLabel = new MirLabel();
            informationLabel->setText(Shortcuts[i]->getInformation());
            informationLabel->setDrawFormat(TextFormatFlags::VerticalCenter);
            informationLabel->setForeColour(Color::White);
            Font tempVar4(Settings::FontName, 9.0F);
            informationLabel->setFont(&tempVar4);
            informationLabel->setParent(this);
            informationLabel->setAutoSize(true);
            Point tempVar5(119, 107 + (20 * i));
            informationLabel->setLocation(&tempVar5);
            Size tempVar6(400, 23);
            informationLabel->setSize(&tempVar6);

            delete informationLabel;
            delete shortcutLabel;
        }
    }

    HelpPage::HelpPage(const std::string &title, int imageID, MirControl *page)
    {
        Title = title;
        ImageID = imageID;
        Page = page;

        setNotControl(true);
        System::Drawing::Size tempVar(508, 396 + 40);
        setSize(&tempVar);

        BeforeDraw += HelpPage_BeforeDraw;

        PageTitleLabel = new MirLabel();
        PageTitleLabel->setText(Title);
        Font tempVar2(Settings::FontName, 10.0F, FontStyle::Bold);
        PageTitleLabel->setFont(&tempVar2);
        PageTitleLabel->setDrawFormat(TextFormatFlags::HorizontalCenter | TextFormatFlags::VerticalCenter);
        PageTitleLabel->setParent(this);
        System::Drawing::Size tempVar3(242, 30);
        PageTitleLabel->setSize(&tempVar3);
        Point tempVar4(135, 4);
        PageTitleLabel->setLocation(&tempVar4);
    }

    void HelpPage::HelpPage_BeforeDraw(std::any sender, EventArgs *e)
    {
        if (ImageID < 0)
        {
            return;
        }

        Point tempVar(getDisplayLocation()->X, getDisplayLocation()->Y + 40);
        Libraries::Help->Draw(ImageID, &tempVar, Color::White, false);
    }
}
